Skip to main content

Setup MCP Server

Used to complete MCP (Model Context Protocol) server setup and configuration. This allows you to configure the connection details, authentication, transport protocol, and other settings required to establish a working connection with an MCP server.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/tools/mcp-server-setup/{tool_id}

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/tools/mcp-server-setup/{tool_id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"server_url": "https://mcp-server.example.com",
"transport": "streamable_http",
"headers": {
"X-Custom-Header": "value"
},
"query_params": {},
"trust_mcp_server": true,
"auth_config": {
"Enabled": true,
"APIToken": "your-api-token",
"APIKeyPrefix": "Bearer",
"APIKeyName": "Authorization"
},
"skip_discovery": false,
"project_key": "YOUR_PROJECT_KEY"
}'

Path Parameters

FieldTypeRequiredDescription
tool_idstringYesThe unique identifier of the MCP server tool.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"server_url": "string",
"transport": "streamable_http",
"headers": {},
"query_params": {},
"trust_mcp_server": true,
"auth_config": {
"Enabled": false,
"OAuth2Config": {
"ClientID": "string",
"ClientSecret": "string",
"TokenURL": "string",
"Scopes": ["string"],
"RefreshToken": "string",
"AccessToken": "string",
"TokenExpiresAt": "2026-01-12T07:28:51.601Z",
"GrantType": "client_credentials",
"AuthorizationEndpoint": "string",
"RedirectURI": "string",
"PKCEConfig": {
"CodeVerifier": "string",
"CodeChallenge": "string",
"CodeChallengeMethod": "S256"
},
"State": "string",
"Nonce": "string"
},
"APIToken": "string",
"APIKeyPrefix": "Bearer",
"APIKeyName": "Authorization",
"AutoDiscoverMetadata": false,
"ServerMetadata": {
"Issuer": "string",
"AuthorizationEndpoint": "string",
"TokenEndpoint": "string",
"RevocationEndpoint": "string",
"IntrospectionEndpoint": "string",
"RegistrationEndpoint": "string",
"ScopesSupported": ["string"],
"ResponseTypesSupported": ["string"],
"GrantTypesSupported": ["string"],
"CodeChallengeMethodsSupported": ["string"]
}
},
"skip_discovery": false,
"project_key": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
server_urlstringYesThe URL endpoint of the MCP server.
transportstringYesTransport protocol (e.g., "streamable_http").
headersobjectNoCustom HTTP headers to include in requests to the MCP server.
query_paramsobjectNoQuery parameters to append to MCP server requests.
trust_mcp_serverbooleanNoWhether to trust the MCP server's SSL certificate (default: true).
auth_configobjectNoAuthentication configuration for the MCP server.
skip_discoverybooleanNoSkip automatic discovery of MCP server capabilities (default: false).
project_keystringYesThe project key for your project.

Authentication Configuration Parameters

FieldTypeDescription
EnabledbooleanWhether authentication is enabled.
OAuth2ConfigobjectOAuth 2.0 authentication configuration.
APITokenstringAPI token for token-based authentication.
APIKeyPrefixstringPrefix for API key (e.g., "Bearer", "Token").
APIKeyNamestringName of the header or parameter for the API key.
AutoDiscoverMetadatabooleanAutomatically discover OAuth server metadata.
ServerMetadataobjectManual OAuth server metadata configuration.

OAuth2 Configuration Parameters

FieldTypeDescription
ClientIDstringOAuth 2.0 client identifier.
ClientSecretstringOAuth 2.0 client secret.
TokenURLstringURL endpoint for obtaining access tokens.
ScopesarrayList of OAuth scopes to request.
RefreshTokenstringRefresh token for obtaining new access tokens.
AccessTokenstringCurrent access token.
TokenExpiresAtstringTimestamp when the access token expires (ISO 8601 format).
GrantTypestringOAuth grant type (e.g., "client_credentials", "authorization_code").
AuthorizationEndpointstringURL endpoint for user authorization.
RedirectURIstringRedirect URI for OAuth callback.
PKCEConfigobjectPKCE (Proof Key for Code Exchange) configuration.
StatestringState parameter for CSRF protection.
NoncestringNonce value for additional security.
note

MCP Server Setup Requirements

  • transport: Currently supports "streamable_http" for streaming HTTP connections
  • auth_config: Choose between OAuth 2.0 or API token authentication
  • OAuth 2.0: Supports multiple grant types including client_credentials, authorization_code, and refresh_token
  • PKCE: Recommended for enhanced security in OAuth flows
  • trust_mcp_server: Set to false in production environments with self-signed certificates
tip

After setting up an MCP server, the system will:

  • Validate the server URL and connection
  • Test authentication credentials if provided
  • Discover available MCP server capabilities (unless skip_discovery is true)
  • Register the server's tools and resources
  • Make the MCP server available for use with AI agents
  • Store configuration securely for future connections

Response

Success Response (200 OK)

Returns an object containing the setup status.

{
"is_success": true,
"item_id": "mcp_server_123",
"detail": "MCP server setup completed successfully. 12 tools discovered.",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the setup was successful.
item_idstringThe identifier of the configured MCP server.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"server_url"
],
"msg": "invalid URL format",
"type": "value_error.url"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid configurationBad Request
401Unauthorized - Authentication failedUnauthorized
404Not Found - MCP server tool does not existNot Found
422Validation Error - Invalid request parametersUnprocessable Entity
503Service Unavailable - Cannot connect to MCP serverService Unavailable